<template>
	<view class="content">
		<view class="list" @click="learningdetails" v-for="item,index in itemList">
			<view class="img">
				<image :src="item.courseCover" mode=""></image>
				<!-- <view class="free">
					免费试看
				</view> -->
			</view>
			<view class="title">
				<view class="name">
					{{item.courseTitle}}
				</view>
				<view class="progressbar" v-if="item.courseSchedule">
					<u-line-progress :percentage="item.courseSchedule" activeColor="#FF9C33"></u-line-progress>
				</view>
				<view class="progressbar" v-if="!item.courseSchedule">
					未开始
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		orderPage //学习
	} from "../../request/api.js"
	export default {
		data() {
			return {
				selectedIdx: 10,
				itemList: [],
			};
		},
		onLoad(options) {},
		onShow() {
			this.orderPagea()
		},
		methods: {
			orderPagea() {
				orderPage({
					status: 2,
					memberId: uni.getStorageSync('userInfo').id
				}).then(res => {
					console.log(res);
					this.itemList = res.result.records
				})
			},
			learningdetails() {
				uni.navigateTo({
					url: '/pages/study/learningdetails'
				})
			},
		},

	};
</script>

<style scoped lang="less">
	.content {
		width: 100%;
		min-height: 100vh;
		box-sizing: border-box;
		padding: 16rpx;
		padding-top: 20rpx;
		background: #F7F7F7;
		// padding-top: 20rpx;
		padding-bottom: 250rpx;
	}

	.list {
		display: flex;
		align-items: center;
		padding: 44rpx 52rpx 28rpx 18rpx;
		background: #ffffff;
		border-radius: 22rpx;
		margin-bottom: 20rpx;

		.img {
			width: 328rpx;
			height: 166rpx;
			position: relative;

			image {
				width: 328rpx;
				height: 166rpx;
			}

			.free {
				position: absolute;
				top: 15rpx;
				left: 15rpx;
				width: 76rpx;
				height: 30rpx;
				border-radius: 16rpx;
				background: #f05555;
				color: #ffffff;
				text-align: center;
				line-height: 30rpx;
				font-size: 16rpx;
				font-weight: 400;
			}
		}

		.title {
			width: 100%;
			height: 166rpx;
			margin-left: 20rpx;
			position: relative;

			.name {
				color: #0c0c0c;
				font-size: 32rpx;
				font-weight: 700;
				margin-bottom: 78rpx;
				// position: absolute;
				// top: 0;
			}

			.progressbar {
				// position: absolute;
				// bottom: 0;
				// z-index: 10;
			}
		}
	}
</style>